:root {
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-blue: #e3f2fd;
  --blue-50: #e6f2ff;
  --blue-100: #bbdefb;
  --blue-200: #90caf9;
  --blue-300: #64b5f6;
  --blue-400: #42a5f5;
  --blue-500: #2196f3;
  --blue-600: #1e88e5;
  --blue-700: #1976d2;
  --black: #212121;
  --grey-50: #fafafa;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-500: #9e9e9e;
  --error-red: #ff3333;
  --error-red-light: #fff5f5;
  --success-green: #4caf50;
  --success-green-light: #f0fff4;
  --warning-orange: #ff9800;
  --accent-teal: #009688;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--off-white) 0%, var(--light-blue) 100%);
  color: var(--black);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--grey-200);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: var(--blue-700);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav a {
  color: var(--grey-500);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav a:hover {
  color: var(--blue-600);
  background-color: var(--blue-50);
  transform: translateY(-2px);
}

.nav a.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.25);
}

.main-content {
  flex: 1;
  padding: 120px 32px 48px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  padding: 3rem;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid var(--blue-100);
  border-radius: 50%;
  border-top-color: var(--blue-600);
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1.5rem;
  color: var(--blue-700);
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.loading-subtext {
  color: var(--grey-500);
  font-size: 0.95rem;
}

.footer {
  background: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  border-top: 1px solid var(--grey-200);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-section h3 {
  color: var(--blue-700);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.footer-section p {
  color: var(--grey-500);
  font-size: 0.95rem;
}

.footer-section a {
  color: var(--grey-500);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  width: fit-content;
}

.footer-section a:hover {
  color: var(--blue-600);
  transform: translateX(4px);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-bottom {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--grey-200);
  color: var(--grey-500);
  font-size: 0.9rem;
}

.cta-button {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: var(--white);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(33, 150, 243, 0.3);
  letter-spacing: 0.01em;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.cta-button:active {
  transform: translateY(0);
}

.cta-button:disabled {
  background: var(--grey-300);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error-message {
  color: var(--error-red);
  background: var(--error-red-light);
  text-align: center;
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-weight: 500;
  border-left: 4px solid var(--error-red);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .header-content {
    padding: 0 24px;
  }

  .main-content {
    padding: 100px 24px 40px;
  }

  .footer-content {
    padding: 0 24px;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 0 16px;
  }

  .logo {
    font-size: 1.5rem;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .nav a {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .main-content {
    padding: 140px 16px 32px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    padding: 0 16px;
  }

  .footer-section {
    align-items: center;
  }

  .social-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 12px;
  }

  .main-content {
    padding: 130px 12px 24px;
  }

  .loading-content {
    padding: 2rem 1.5rem;
  }

  .cta-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.profile-grid {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 32px;
  animation: fadeIn 0.6s ease-out;
}

.profile-sidebar {
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--grey-200);
  height: fit-content;
}

.profile-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--blue-100);
  display: block;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.profile-name {
  font-size: 1.5rem;
  color: var(--blue-700);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.profile-status {
  color: var(--blue-500);
  font-weight: 500;
}

.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--grey-50);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
}

.stat-item:hover {
  background: var(--blue-50);
  border-left-color: var(--blue-500);
  transform: translateX(4px);
}

.stat-item i {
  color: var(--blue-500);
  font-size: 1.25rem;
}

.form-container {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--grey-200);
  transition: all 0.3s ease;
}

.form-container:hover {
  box-shadow: var(--shadow-lg);
}

.form-container h1 {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--blue-700);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--blue-100);
}

.inputForm {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--grey-500);
  transition: color 0.3s ease;
}

.toggle-password:hover {
  color: var(--blue-500);
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--grey-500);
  font-weight: 600;
  font-size: 0.875rem;
}

.form-group label i {
  color: var(--blue-500);
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--grey-200);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--white);
}

.form-group input:hover {
  border-color: var(--blue-300);
}

.form-group input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

.form-group input.bg-gray-50 {
  background: var(--grey-50);
}

.credits-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.buy-credits-btn,
.change-password-btn {
  background: none;
  border: none;
  color: var(--blue-500);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  padding: 0.5rem;
  border-radius: 8px;
}

.buy-credits-btn:hover,
.change-password-btn:hover {
  color: var(--blue-600);
  background: var(--blue-50);
  transform: translateX(4px);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.primary-button,
.secondary-button,
.danger-button {
  flex: 1;
  min-width: 150px;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(33, 150, 243, 0.3);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.secondary-button {
  background: var(--grey-100);
  color: var(--black);
}

.secondary-button:hover {
  background: var(--grey-200);
  transform: translateY(-2px);
}

.danger-button {
  background: linear-gradient(135deg, var(--error-red), #d32f2f);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(255, 51, 51, 0.3);
}

.danger-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 51, 51, 0.4);
}

.profile-activity {
  background: var(--white);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--grey-200);
}

.profile-activity h3 {
  color: var(--blue-700);
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--grey-50);
  border-radius: 12px;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  border-left: 3px solid transparent;
}

.activity-item:hover {
  background: var(--blue-50);
  border-left-color: var(--blue-500);
  transform: translateX(4px);
}

.activity-item i {
  color: var(--blue-500);
  font-size: 1.25rem;
}

.activity-content p {
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: var(--black);
}

.activity-content span {
  font-size: 0.875rem;
  color: var(--grey-500);
}

@media (max-width: 1200px) {
  .profile-grid {
    grid-template-columns: 280px 1fr;
  }

  .profile-activity {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-activity {
    grid-column: auto;
  }

  .action-buttons {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
  }
}
